package Day14;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class SavePanel extends JPanel implements ActionListener {
    private JLabel saveLabel = new JLabel("金额");
    private JTextField saveField = new JFormattedTextField();
    private JButton sureBtn = new JButton(new ImageIcon("Image/buttonSure.jpg"));
    private Font font = new Font("宋体",Font.BOLD,20);
    private ATM05 atm05;
    public SavePanel(ATM05 atm05){
        this.atm05 = atm05;
        this.setLayout(null);
        this.setOpaque(false);

        saveLabel.setBounds(250,200,80,50);
        saveLabel.setFont(font);
        this.add(saveLabel);

        saveField.setBounds(380,200,250,50);
        saveField.setFont(font);
        this.add(saveField);

        sureBtn.setBounds(450,320,140,50);
        sureBtn.addActionListener(this);
        this.add(sureBtn);
    }
    @Override
    public void actionPerformed(ActionEvent e) {
        atm05.showPanel("menu");
    }
}
